package com.dujiu.config;

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

@Component
public class RedissonConfig {

    @Bean
    public RedissonClient redissonClient(){
        // 配置类
        Config config = new Config();
        // 修改 Redis 地址格式，添加 redis:// 前缀
        config.useSingleServer().setAddress("redis://192.168.88.130:6379").setPassword("lzj2357111317");
        // 创建客户端
        return Redisson.create(config);
    }
}
